********** Fear or Anger? Leaders' Childhood War Trauma and the Initiation of Militarized Disputes
********** Author: James D. Kim 
********** Date: 03/08/2024

**For any questions about the data, please contact the author at kimjames@mit.edu

* Before running this do file, change the working directory to the folder where the dataset is located.
*cd "/Users/jamesdkim/Library/CloudStorage/Dropbox/Working Papers/Leader War Exposure and Conflict Behavior/ISQ R&R/Replication-ISQ"

use leader_warexp_final, clear
sort ccode year
eststo clear 

** Main Paper Table 1
*** Model 1: Unconditional Hypothesis
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model2
*** Model 3: Interactive model (continuous) 
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model3
*** Model 3: Interactive model (continuous) + TWFE
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model4

esttab using table1.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Regression Analysis of Leaders' Childhood War Trauma and Conflict Initiation\label{reg1})


* Main Paper Figure 1
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
margins, dydx(cwtrauma) at(polity2==(-10 (1) 10))
marginsplot
graph save graph1, replace

logit midonset i.cwtrauma##i.dem age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
margins, dydx(cwtrauma) at(dem==(0 1))
marginsplot
graph save graph2, replace

* Predicted probability calculation (mentioned in the main paper) 
logit midonset i.cwtrauma##i.dem age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
margins, at(cwtrauma=(0 1) dem=(0 1)) 

logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
margins, at(cwtrauma=(0 1))


**Main Paper Table 2: All leader sample
*** Model 1: Unconditional Hypothesis
logit midonset cwtrauma_all noinvasion_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
logit midonset cwtrauma_all noinvasion_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year, robust cluster(ccode)
eststo model2
*** Model 3: Unconditional Hypothesis
logit midonset cwtrauma_all invasion_notrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode, robust cluster(ccode)
eststo model3
** Model 4: Unconditional Hypothesis + TWFE
logit midonset cwtrauma_all invasion_notrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year, robust cluster(ccode)
eststo model4

esttab using table2.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Analysis of All Leader Sample\label{reg2})



**Appendix
*Table 1: All leader sample with additional control variables
*** Model 1: Unconditional Hypothesis
logit midonset cwtrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
logit midonset cwtrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year, robust cluster(ccode)
eststo model2
*** Model 3: Unconditional Hypothesis (additional controls)
logit midonset cwtrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol growth theta2_mean preWW1 interwar postWW2 postCW time time2 time3 i.ccode, robust cluster(ccode)
eststo model3
** Model 4: Unconditional Hypothesis + TWFE (additional controls)
logit midonset cwtrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol growth theta2_mean time time2 time3 i.ccode i.year, robust cluster(ccode)
eststo model4

esttab using table3.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Analysis of All Leader Sample with Additional Control Variables\label{reg3})


*Table 2: Three Mutually Exclusive Dummy Variables
*** Model 1: Unconditional Hypothesis
logit midonset cwtrauma_all noinvasion_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
logit midonset cwtrauma_all noinvasion_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year, robust cluster(ccode)
eststo model2
*** Model 3: Unconditional Hypothesis
logit midonset cwtrauma_all invasion_notrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode, robust cluster(ccode)
eststo model3
** Model 4: Unconditional Hypothesis + TWFE
logit midonset cwtrauma_all invasion_notrauma_all polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year, robust cluster(ccode)
eststo model4

esttab using table4.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Three Mutually Exclusive Dummy Variables\label{reg4})


**Table 3: Sensitivity Analysis (Main model) 
*** Model 1: Non-Europe
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1 & ccode < 200 | ccode > 400, robust cluster(ccode)
eststo model1
*** Model 2: Non-Europe + TWFE
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1 & ccode < 200 | ccode > 400, robust cluster(ccode)
eststo model2
*** Model 3: Post-WWI
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1 & year > 1918, robust cluster(ccode)
eststo model3
*** Model 4: Post-WWI + TWFE
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.year i.ccode if invasion_dum==1 & year > 1918, robust cluster(ccode)
eststo model4
*** Model 5: Post-WWII
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1  & year > 1945, robust cluster(ccode)
eststo model5
*** Model 5: Post-WWII + TWFE
logit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1  & year > 1945, robust cluster(ccode)
eststo model6

esttab using table5.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Sensitivity Analysis: Main Model\label{reg5})


**Table 4: Sensitivity Analysis (interactive model) 
*** Model 1: Non-Europe
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1 & ccode < 200 | ccode > 400, robust cluster(ccode)
eststo model1
*** Model 2: Non-Europe
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1 & ccode < 200 | ccode > 400, robust cluster(ccode)
eststo model2
*** Model 3: Post-WWI
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1  & year > 1918, robust cluster(ccode)
eststo model3
*** Model 4: Post-WWI
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1  & year > 1918, robust cluster(ccode)
eststo model4
*** Model 5: Post-WWII
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1 & year > 1945, robust cluster(ccode)
eststo model5
*** Model 6: Post-WWII
logit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1 & year > 1945, robust cluster(ccode)
eststo model6

esttab using table6.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Sensitivity Analysis: Interaction Model\label{reg6})


eststo clear 
** Table 5: Alternate DV: High-level Disputes
*** Model 1: Unconditional Hypothesis
logit midonset_mid cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time_mid time2_mid time3_mid i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
logit midonset_mid cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time_mid time2_mid time3_mid i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model2
*** Model 3: Interactive model (continuous) 
logit midonset_mid i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time_mid time2_mid time3_mid i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model3
*** Model 3: Interactive model (continuous) + TWFE
logit midonset_mid i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time_mid time2_mid time3_mid i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model4

esttab using table7.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(High-level Conflict Initiation\label{reg7})


**Table 6: Ordinal IV (2: severe trauma - 1: less severe trauma - 0: none) 
*** Model 1: Unconditional Hypothesis
logit midonset cwtrauma_ord polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
logit midonset cwtrauma_ord polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model2
*** Model 3: Interactive model (continuous) 
logit midonset c.cwtrauma_ord##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model3
*** Model 3: Interactive model (continuous) + TWFE
logit midonset c.cwtrauma_ord##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model4

esttab using table8.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Ordinal Independent Variable\label{reg8})


**Table 7: Placebo test
*** Model 1: Unconditional Hypothesis
logit midonset famdeath_nowar polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model1
*** Model 2: Unconditional Hypothesis + TWFE
logit midonset famdeath_nowar polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model2
*** Model 3: Interactive model (continuous) 
logit midonset i.famdeath_nowar##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model3
** Model 4: Interactive model (continuous) + TWFE
logit midonset i.famdeath_nowar##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model4

esttab using table9.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Placebo Test: Childhood Experience of Family Members' Deaths Due to Reasons Not Related to War\label{reg9})


**Table 8: Alternative political constraints variable
*** Model 3: V-Dem
logit midonset i.cwtrauma##c.v2x_polyarchy age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model1
*** Model 4: V-Dem + TWFE
logit midonset i.cwtrauma##c.v2x_polyarchy age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model2
*** Model 5: V-Dem constraints 
logit midonset i.cwtrauma##c.v2xlg_legcon age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model3
*** Model 6: V-Dem constraints + TWFE
logit midonset i.cwtrauma##c.v2xlg_legcon age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model4

esttab using table10.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Alternative Political Constraints Variable\label{reg10})


**Table 9: Conditional fixed effects logit
*** Model 1: Unconditional Hypothesis
clogit midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 if invasion_dum==1, group(ccode)
eststo model1
*** Model 2: Interactive model (continuous) 
clogit midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 if invasion_dum==1, group(ccode)
eststo model2
clogit midonset cwtrauma v2x_polyarchy age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 if invasion_dum==1, group(ccode)
eststo model3
*** Model 2: Interactive model (continuous) 
clogit midonset i.cwtrauma##c.v2x_polyarchy age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 if invasion_dum==1, group(ccode)
eststo model4

esttab using table11.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Conditional Fixed Effects Logistic Model\label{reg11})


**Table 10: Linear Probability Model (LPM) 
*** Model 1: Unconditional Hypothesis
reg midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
reg midonset cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model2
*** Model 3: Interactive model (continuous) 
reg midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model3
*** Model 3: Interactive model (continuous) + TWFE
reg midonset i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model4

esttab using table12.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(N r2, label("N Obs." "Overall $R^2$")) nogaps scalars("N Obs." "R squared" ) ///
title(Linear Probability Model\label{reg12})


**Table 11: Count DV model
*** Model 1: Unconditional Hypothesis
poisson midcount cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model1
** Model 2: Unconditional Hypothesis + TWFE
poisson midcount cwtrauma polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model2
*** Model 3: Interactive model (continuous) 
poisson midcount i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol preWW1 interwar postWW2 postCW time time2 time3 i.ccode if invasion_dum==1, robust cluster(ccode)
eststo model3
*** Model 3: Interactive model (continuous) + TWFE
poisson midcount i.cwtrauma##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
eststo model4

esttab using table13.tex, replace label se nodepvars booktabs alignment(l) width(0.8\hsize) ///
b(a3) addn(Robust standard errors are clustered by countries and in parentheses.) /// 
star(+ 0.10 * 0.05 ** .01 *** .001) stats(ll N, label("ll Log Lik." "N Obs.")) nogaps scalars("N Obs." "ll Log Lik." ) ///
title(Count DV and Poisson Regression Model\label{reg13})


**Figure 1
logit midonset i.cwtrauma_all##c.polity2 age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol growth theta2_mean time time2 time3 i.ccode i.year, robust cluster(ccode)
margins, dydx(cwtrauma_all) at(polity2==(-10 (1) 10))
marginsplot
graph save graph3, replace


**Figure 2
logit midonset i.cwtrauma##c.v2xlg_legcon age gender milnoncombat combat rebel ln_cinc major_ally status_dissat_l5 total viol time time2 time3 i.ccode i.year if invasion_dum==1, robust cluster(ccode)
margins, dydx(cwtrauma) at(v2xlg_legcon==(0 (0.1) 1))
marginsplot
graph save graph4, replace


**Figure 3,4: Imai, Kim, and Wang (2021) method
*Using R 
*Refer to a seperate R script file "PanelMatch.R" 

